Skip to content

config: remove possibility of nothing return from get_config#302

Merged
aviatesk merged 1 commit intomasterfrom
avi/type-stable-get_config
Nov 18, 2025
Merged

config: remove possibility of nothing return from get_config#302
aviatesk merged 1 commit intomasterfrom
avi/type-stable-get_config

Conversation

@aviatesk
Copy link
Copy Markdown
Owner

Our current configuration system uses Configuration.Maybe to distinguish between "no configuration set" and "user has set some configuration", essentially allowing each configuration to be represented as nothing. As a result, get_config is currently set up to potentially return nothing, but call sites throughout the codebase do not handle cases where nothing is returned.

get_config is fundamentally used to retrieve some configuration value regardless of whether it is a default or not, and there is no need to return nothing in the first place.

This commit fixes get_config to never return nothing in all cases using DEFAULT_CONFIG, resolving this logic error and type instability.

Our current configuration system uses `Configuration.Maybe` to
distinguish between "no configuration set" and "user has set some
configuration", essentially allowing each configuration to be
represented as `nothing`. As a result, `get_config` is currently set up
to potentially return `nothing`, but call sites throughout the codebase
do not handle cases where `nothing` is returned.

`get_config` is fundamentally used to retrieve some configuration value
regardless of whether it is a default or not, and there is no need to
return `nothing` in the first place.

This commit fixes `get_config` to never return `nothing` in all cases
using `DEFAULT_CONFIG`, resolving this logic error and type instability.
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.17%. Comparing base (32021a6) to head (0460075).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/types.jl 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
+ Coverage   69.14%   69.17%   +0.03%     
==========================================
  Files          39       39              
  Lines        3915     3916       +1     
==========================================
+ Hits         2707     2709       +2     
+ Misses       1208     1207       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aviatesk aviatesk merged commit d603d62 into master Nov 18, 2025
11 of 12 checks passed
@aviatesk aviatesk deleted the avi/type-stable-get_config branch November 18, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant